#include <cstdio>
#include <queue>
#include <stack>

using namespace std;

struct Node
{
    int a[ 9 ], place, h;
};

char begin[ 2 ], cmd[ 362880 ];
queue<Node> q;
bool nosolution, hash_table[ 362880 ];
int w[ ] = { 1, 1, 2, 6, 24, 120, 720, 5040, 40320 }, prev[ 363880 ];

inline int hash( Node p )
{
    register int i, j, cnt, end, r = 0;
    for ( i = 1; i < 9; i++ )
    {
        for ( cnt = j = 0; j < i; j++ )
            if ( p.a[ j ] > p.a[ i ] )
                cnt++;
        r += cnt * w[ 9 - p.a[ i ] ];
    }
    return r;
}

bool check_solution( Node p )
{
    int i, j, count = 0;
    for ( i = 0; i < 9; i++ )
    {
        for ( j = 0; j < i; j++ )
            if ( p.a[ j ] == 9 )
                continue;
            else
                if ( p.a[ j ] > p.a[ i ] )
                    count++;
    }
    if ( count & 1 )
        return false;
    return true;
}

Node input( )
{
    Node p;
    int i;
    char data[ 2 ];
    if ( begin[ 0 ] == 'x' )
        p.a[ 0 ] = 9;
    else
        p.a[ 0 ] = begin[ 0 ] - '0';
    for ( i = 1; i < 9; i++ )
    {
        scanf("%s", data);
        if ( data[ 0 ] == 'x' )
            p.a[ i ] = 9;
        else
            p.a[ i ] = data[ 0 ] - '0';
    }
    return p;
}

void init( )
{
    int i;
    Node p;
    for ( i = 0; i < 362880; i++ )
    {
        prev[ i ] = -1;
        hash_table[ i ] = false;
    }
    for ( i = 0; i < 9; i++ )
        p.a[ i ] = i + 1;
    p.place = 8;
    p.h = hash( p );
    hash_table[ p.h ] = true;
    q.push( p );
}

void move( Node p, char command )
{
    int x = p.place / 3, y = p.place % 3, s, t;
    switch ( command )
    {
        case 'l': y++; break;
        case 'r': y--; break;
        case 'd': x--; break;
        case 'u': x++; break;
    }
    if ( x < 0 || x > 2 || y < 0 || y > 2 )
        return ;
    t = x * 3 + y;
    s = p.a[ t ];
    p.a[ t ] = 9;
    p.a[ p.place ] = s;
    p.place = t;
    s = hash( p );
    if ( !hash_table[ s ] )
    {
        hash_table[ s ] = true;
        cmd[ s ] = command;
        prev[ s ] = p.h;
        p.h = s;
        q.push( p );
    }
}

void print( Node p )
{
    int t = hash( p );
    while ( prev[ t ] != -1 )
    {
        printf("%c", cmd[ t ]);
        t = prev[ t ];
    }
    printf("\n");
}

void work( )
{
    Node p;
    while ( !q.empty( ) )
    {
        p = q.front( );
        q.pop( );
        move( p, 'u' );
        move( p, 'd' );
        move( p, 'r' );
        move( p, 'l' );
    }
}

int main( )
{
    Node p;
    init( );
    work( );
    while ( scanf("%s", begin) != EOF )
    {
        p = input( );
        if ( check_solution( p ) )
            print( p );
        else
            puts("unsolvable");
    }
    return 0;
}
